How to create N x M x ... matrix in javascript dynamically